//
//  DYLotteryDecisionImageCell.m
//  DaYing
//
//  Created by DaYing  on 2023.
//  Copyright © 2023年 DaYing . All rights reserved.
//

#import "DYLotteryDecisionImageCell.h"

@implementation DYLotteryDecisionImageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.tag = 10000;
}

- (void)setData:(id)data delegate:(id)delegate {

}

//开点按钮功能呢
- (void)start {
    //实例化
    CAKeyframeAnimation *anim = [CAKeyframeAnimation animation];
    //拿到动画key
    anim.keyPath = @"transform.rotation";
    //动画时间
    anim.duration = 0.1;
    //重复的次数
    //anim.repeatCount = 16;
    //无限次重复
    anim.repeatCount = MAXFLOAT;
    //设置抖动数值
    anim.values = @[@(ANGLE_TO_RADIAN(-5)),@(ANGLE_TO_RADIAN(5)),@(ANGLE_TO_RADIAN(-5))];
    //保持最后的状态
    anim.removedOnCompletion = NO;
    //动画的填充模式
    anim.fillMode = kCAFillModeForwards;
    //layer层实现动画
    [_myimageView.layer addAnimation:anim forKey:@"shake"];
}

//点击结束按钮
- (void)end {
    //图标
    [_myimageView.layer removeAnimationForKey:@"shake"];
}

@end
